<%@ page contentType="text/html; charset=utf-8"%>
<%@page import="java.util.*,com.vm.common.QueryObject"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<% 
QueryObject queryObject= (QueryObject)request.getSession().getAttribute("queryObject");;
String attribs="";
  int i=0;
  if(queryObject!=null){
	for (Iterator iterator = queryObject.getQueryOptionMap().keySet().iterator(); iterator.hasNext();) {
		String key = (String) iterator.next();
		attribs+=key+"$"+queryObject.getQueryOptionMap().get(key);
		if(i!=queryObject.getQueryOptionMap().size()-1){
			attribs+=",";
		}
		i++;
	} 
  }
	//System.out.println("查询条件： "+attribs);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		 <script type="text/javascript">
		         function loadSearchOptions(){
	                 //window.onload=function(){
						  var map='<%=queryObject!=null?queryObject.getQueryOptionMap():null%>';
						  if(map!=null){
							  var keyValue=map.toString().substring(1,map.length-1).split(",");
							  var attrib,value;
							  for(var i=0;i<keyValue.length;i++){
								  attrib=keyValue[i].substring(0,keyValue[i].lastIndexOf("="));
								  value=keyValue[i].substring(attrib.length+1,keyValue[i].length);
								  attrib=attrib.replace(" ","");
								   if(document.all["@"+attrib]){
			            			    document.all["@"+attrib].value=value;
			            		   }
							  }
						   }
						<%---
					     // var key = map.keySet();
						  //for (var i in key){
						//	 alert(map.get(key[i]));
						 // }
	            	 
	            	   <%----
	            	   var options=params.split(",");
	            	   var attrib,value;
           		     for(var i=0;i<options.length;i++){
            		   attrib=options[i].split("$")[0]; 
            		   value=options[i].split("$")[1];
            		   if(document.all["@"+attrib]){
            			    document.all["@"+attrib].value=value;
            		   }
           	         }
	            	 
	            	   //=params.split("$")[0].replace("&","&amp;");
	            	   //var value=params.split("$")[1];
	            	  //alert(params);
	            	   
	            	   
	            	   	 var map="";
	            	   	 
				    	 var ss="";
				    	 var v1="";
				    	 if(map!=null){
				    		  for(var k in map){
					    		   //if(map[k]!=null && map[k]!=''){
					    			   ss+=map[k]+" ** ";
					    		 // }
				    	       } 
				    	 }
				    	 var params=ss.substring(ss.indexOf("{")+1, ss.indexOf("}")).split(",");  //找到{}的位置  {eqpinfo.eqpNo=234324,eqpinfo.eqpeo=234324}
				    	 for(var i=0;i<params.length;i++){
				    		  var p=params[i].replace("&amp;","&");  //将 eqpinfo.eqpNo=234324
				    		  var attrib="";
				    		  var value="";
				    		  if(p.indexOf("=")>0 ){
				    			   attrib=p.substring(0,p.lastIndexOf("="));
				    			  // value=p.substring((p.lastIndexOf("=")+1),(p.length()-1));
				    			   //value=p.split("=")[1].replace("=","");
				    			  // alert(p.split("=")[1]);
				    		  } 
                               // alert(attrib+"   ---------  "+value);
				    		 // var attribs=p.split("=");
				    		//var attribs=params[i].split("=");
				    		//var attrib=attribs[0];
				    		//if(attribs[0].indexOf(">")!=-1 || attribs[0].indexOf("<")!=-1){
				    		//	attrib+="=";
				    		//}
				    		// var value=attribs[1];
				    		 if(document.all[attrib]){
				    			  ///alert(attrib);
				    			  document.all[attrib].value=value;
				    		 }
				    		
				    	 }---%>
	               }  
	                 
	                 	        //显示/隐藏查询条件
		     function showHideQueryDiv(){
			     var moreSearchdiv=document.getElementById("moreSearchdiv");
			     if(moreSearchdiv.style.display=='block'){
			    	 moreSearchdiv.style.display='none';
			     }else{
			    	  moreSearchdiv.style.display='block';
			     }
			
		     }
		     //显示更多查询
		     function showMore(target){
		    	 if(target=='moreDiv1'){
		    		 document.getElementById("moreDiv1").style.display='none';
		    		 document.getElementById("moneyQueryDiv").style.display='block';
		    	 }else{
		    		 document.getElementById("moreDiv1").style.display='block';
		    		 document.getElementById("moneyQueryDiv").style.display='none';
		    	 }
		     }
			   </script>
	</head>
	<body >
		 
	</body>
</html>
